package tmt.usercenter.web.configure.emailservice;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by ThreeManTeam on 2017/5/20.
 */
@Configuration
public class EmailServiceConfig {

    @Value("${email.server}")
    private String emailServer;

    @Value("${email.from}")
    private String fromEmail;

    @Value("${email.auth-code}")
    private String authCode;

    private final Logger logger = LoggerFactory.getLogger(EmailServiceConfig.class);

    @Bean
    public IEmailSender emailSender() {
        return new DefaultEmailSender(emailServer, fromEmail, authCode);
    }

}
